package com.ruoyi.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.domain.ExExperimentMain;
import com.ruoyi.mapper.ExExperimentMainMapper;
import com.ruoyi.service.IExExperimentMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 学生实验主Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-24
 */
@Service
public class ExExperimentMainServiceImpl implements IExExperimentMainService
{
    @Autowired
    private ExExperimentMainMapper exExperimentMainMapper;

    /**
     * 查询学生实验主
     * 
     * @param id 学生实验主主键
     * @return 学生实验主
     */
    @Override
    public ExExperimentMain selectExExperimentMainById(String id)
    {
        return exExperimentMainMapper.selectExExperimentMainById(id);
    }

    /**
     * 查询学生实验主列表
     * 
     * @param exExperimentMain 学生实验主
     * @return 学生实验主
     */
    @Override
    public List<ExExperimentMain> selectExExperimentMainList(ExExperimentMain exExperimentMain)
    {
        return exExperimentMainMapper.selectExExperimentMainList(exExperimentMain);
    }

    @Override
    public List<ExExperimentMain> selectExExperimentMainListStastic(ExExperimentMain exExperimentMain) {
        return exExperimentMainMapper.selectExExperimentMainListStastic(exExperimentMain);
    }

    /**
     * 新增学生实验主
     * 
     * @param exExperimentMain 学生实验主
     * @return 结果
     */
    @Override
    public int insertExExperimentMain(ExExperimentMain exExperimentMain)
    {
        exExperimentMain.setCreateTime(DateUtils.getNowDate());
        return exExperimentMainMapper.insertExExperimentMain(exExperimentMain);
    }

    /**
     * 修改学生实验主
     * 
     * @param exExperimentMain 学生实验主
     * @return 结果
     */
    @Override
    public int updateExExperimentMain(ExExperimentMain exExperimentMain)
    {
        return exExperimentMainMapper.updateExExperimentMain(exExperimentMain);
    }

    /**
     * 批量删除学生实验主
     * 
     * @param ids 需要删除的学生实验主主键
     * @return 结果
     */
    @Override
    public int deleteExExperimentMainByIds(String[] ids)
    {
        return exExperimentMainMapper.deleteExExperimentMainByIds(ids);
    }

    /**
     * 删除学生实验主信息
     * 
     * @param id 学生实验主主键
     * @return 结果
     */
    @Override
    public int deleteExExperimentMainById(String id)
    {
        return exExperimentMainMapper.deleteExExperimentMainById(id);
    }
}
